#!/bin/bash
# Write a shell script which reads the contents in a text file and removes
# all the blank spaces in them and redirects the output to a file.
# -------------------------------------------------------------------------
# Copyright (c) 2001 nixCraft project <http://cyberciti.biz/fb/>
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# -------------------------------------------------------------------------
out="output.$$"
echo -n "Enter a file name : "
read file
 
if [ ! -f $file ]
then
	echo "$file not a file!"
	exit 1
fi
 
sed -e 's/[\t ]//g;/^$/d' $file > "$file.tmp"

mv "$file.tmp" $file
